﻿//using System;
//using System.IO;
//using System.Globalization;
//using System.Collections.Generic;
//using System.Windows;
//using System.Windows.Media;
//using System.Windows.Media.Imaging;

//namespace Petra.Gis.Imaging
//{
//  public class TransformWPF
//  {



//    public static void testBitmaps()
//    {

//      //BitmapImage bitImage = new BitmapImage()
//      //{
//      //  UriSource = new Uri(@"C:\temp\cit1.png", UriKind.Relative),
//      //  //DecodePixelWidth = 200,
//      //  //DecodePixelHeight = 200
//      //};

//      BitmapImage bitImage = new BitmapImage();
//      bitImage.BeginInit();
//      bitImage.UriSource = new Uri(@"C:\temp\cit1.png", UriKind.RelativeOrAbsolute);
//      bitImage.EndInit();


//      TransformedBitmap tb = new TransformedBitmap();
//      // Rotate the bitmap 90 degrees.
//      tb.BeginInit();
//      tb.Source = bitImage;
//      RotateTransform transform = new RotateTransform(45);
//      tb.Transform = transform;
//      tb.EndInit();

//      //FormattedText text = new FormattedText("Winter", new CultureInfo("en-us"), FlowDirection.RightToLeft, new Typeface("Calibri", FontStyles.Normal, FontWeights.Normal, new FontStretch()), this.FontSize, Brushes.White);

//      DrawingVisual drawingVisual = new DrawingVisual();
//      DrawingContext drawingContext = drawingVisual.RenderOpen();

//      //drawingContext.DrawDrawing(bitImage);

//      //drawingContext.DrawImage(bitImage, new Rect(0, 0, bitImage.Width, bitImage.Height));
//      drawingContext.DrawImage(bitImage, new Rect(0, 0, tb.Width, tb.Height));
//      //drawingContext.DrawText(text, new Point(bitImage.Height / 2, 0));
//      drawingContext.Close();

//      RenderTargetBitmap renderBmap = new RenderTargetBitmap(tb.PixelWidth, tb.PixelHeight, 96, 96, PixelFormats.Pbgra32);
//      renderBmap.Render(drawingVisual);

//      // Encoding the RenderBitmapTarget as a PNG file. 

//      PngBitmapEncoder png = new PngBitmapEncoder();
//      png.Frames.Add(BitmapFrame.Create(renderBmap));
//      using (Stream stm = File.Create(@"c:\temp\new.png"))
//      {
//        png.Save(stm);

//      }  




//    }


//  }
//}
